home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20000217-20000824
/
000040_news@columbia.edu _Wed Feb 23 13:40:31 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2000-08-23
|
2KB
Return-Path: <news@columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id NAA05463
for <kermit.misc@watsun.cc.columbia.edu>; Wed, 23 Feb 2000 13:40:31 -0500 (EST)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id NAA22464
for kermit.misc@watsun.cc.columbia.edu; Wed, 23 Feb 2000 13:13:27 -0500 (EST)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Subject: Re: Array name passed to macro as argument?
Date: 23 Feb 2000 18:13:25 GMT
Organization: Columbia University
Message-ID: <891805$ltt$1@newsmaster.cc.columbia.edu>
To: kermit.misc@columbia.edu
In article <8915uc$4e2$1@nnrp1.deja.com>,
Peter Easthope <peter_easthope@gulfnet.pinc.com> wrote:
: In <88u9fb$ev5$1@newsmaster.cc.columbia.edu>
: posted at 22 Feb 2000 15:20:11 GMT Frank da Cruz said,
: fdc> ... in C-Kermit 7.0 / K95 1.1.19, you can write this more
: simply ... declare \&d[] = Sea urchin.
:
: Thanks Frank. It is in my memory banks for future
: use. The current application is meant to run on MS-DOS
: Kermit also; for now I will retain the more primitive
: notation to declare the array.
:
: fdc> Here's a version of your Test macro that works:
:
: def test {
: local \%x
: .\%x := \\&\%1[1]
: echo {\%x}
: .\%x := \\&\%1[2]
: echo {\%x}
: }
:
: MS-DOS Kermit complains: "?More parameters are needed".
:
: What does the "." in ".\%x" mean? What
: documentation is recommended for these details?
:
That's a new "programmer friendly" assignment notation, but
it only works in K95 and C-Kermit.
OK, here's another way that works in MS-DOS Kermit 3.15, as
well as in K95 and C-Kermit:
def arraytest { ; Define macro
local \%x
assign \%x \\\%1[1]
echo {\%x}
assign \%x \\\%1[2]
echo {\%x}
}
declare \&a[10] ; Set up array
assign \&a[1] one
assign \&a[2] two
assign \&a[3] three
arraytest &a ; Call macro with array name.
Note that TEST is a built-in command in MS-DOS Kermit. Backslash
craziness is avoided by passing the array name to the macro sans
backslash. The statement:
assign \%x \\\%1[1]
constructs the string \&a[1] and assigns it to \%x.
- Frank